   
   <!--抵押和混合公用页面-->
   		
   <div class="container containerShadow">
        <div class="row">
            <div class="topimg clearfix">
                <div class="left pull-left">
                    <span>转让信息</span>
                </div>
                
                 <div class="zhuanRang">
	                <p>
	                    <span>转让方式</span>
	                    <label for="xieYi" class="<?= !empty($transfer['chi']['method']) && $transfer['chi']['method']==1?'active':''?>" data-val="<?= Yii::$app->params['project_transfer_method'][1]['val']?>">协议</label>
	                    <input type="radio" name="zhuanRangMode" id="xieYi"/>
	                    <label for="gongKai" class="<?= !empty($transfer['chi']['method']) && $transfer['chi']['method']==2?'active':''?>"  data-val="<?= Yii::$app->params['project_transfer_method'][2]['val']?>">公开竞价</label>
	                    <input type="radio" name="zhuanRangMode" id="gongKai"/>
	                    <label for="anBiao" class="<?= !empty($transfer['chi']['method']) && $transfer['chi']['method']==3?'active':''?>"  data-val="<?= Yii::$app->params['project_transfer_method'][3]['val']?>">暗标竞价</label>
	                    <input type="radio" name="zhuanRangMode" cid="anBiao"/>
                        <label for="syq" class="<?= !empty($transfer['chi']['method']) && $transfer['chi']['method']==4?'active':''?>"  data-val="<?= Yii::$app->params['project_transfer_method'][4]['val']?>">收益权竞价</label>
                        <input type="radio" name="zhuanRangMode" cid="syq"/>
                        <label for="other" class="<?= !empty($transfer['chi']['method']) && $transfer['chi']['method']==5?'active':''?>"  data-val="<?= Yii::$app->params['project_transfer_method'][5]['val']?>">其他</label>
                        <input type="radio" name="zhuanRangMode" cid="other"/>
                    </p>
	                <p style="margin-top: 13px">
	                    <span class="pull-left yTimeN">预计转让时间</span>
	                    <span class="pull-left yTime">
									<input type="text" id="expected_transfer" name="" style="margin-top: 6px;" class="textarea-edit9" value="<?= !empty($transfer['chi']['expected_transfer'])?$transfer['chi']['expected_transfer']:''; ?>"/>
								</span>
	                </p>
	                <p class="jiaGe clearfix">
	                    <span class="pull-left">转让意愿</span>
	                    <span class="pull-left">
									<textarea name="" rows="" style="line-height: 20px;    margin-left: 9px" cols=""  class="textarea-edit9" id="wish"><?= !empty($transfer['chi']['wish'])?$transfer['chi']['wish']:""; ?></textarea>
						</span>
	                </p>
	                <p class="jiaGe clearfix">
	                    <span class="pull-left">转让价格</span>
	                    <span class="pull-left">
									<textarea name="" rows="" style="line-height: 20px;    margin-left: 9px"   class="textarea-edit9" id="detail"><?= !empty($transfer['chi']['detail'])?$transfer['chi']['detail']:""; ?></textarea>
								</span>
	                </p>
	            </div>

                <!--<div class="pull-right">
                    <a href="###">
                        <img  class="editImg" src="image/projectDetails/edit.png">
                    </a>
                </div>-->
                <div class="text clearfix">
                    <span>&nbsp;&nbsp;&nbsp;资产包提供方&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <?php
                    if (!empty($transfer['ju']['transfer']) && $transfer['ju']['transfer']==2){
                        echo ' <span class="juJian active">居间人</span><span class="chiYou">持有人</span>';
                    }else if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                        echo ' <span class="juJian">居间人</span><span class="chiYou active">持有人</span>';
                    }else{
                        echo ' <span class="juJian">居间人</span>
                    <span class="chiYou active">持有人</span>';
                    }
                    ?>

                </div>
            </div>
            <div class="tableBox clearfix">
                <form action="" id="cj">
                    <?php
                    if (!empty($transfer)){
                        if (!empty($transfer['ju']['transfer']) && $transfer['ju']['transfer']==2){
                            $contactJu = !empty($transfer['ju']['contact'])?$transfer['ju']['contact']:'' ;
                            $phoneJu = !empty($transfer['ju']['phone'])?$transfer['ju']['phone']:'' ;
                            $emailJu = !empty($transfer['ju']['email'])?$transfer['ju']['email']:'' ;
                            $addressJu = !empty($transfer['ju']['address'])?$transfer['ju']['address']:'' ;
                            $positionJu = !empty($transfer['ju']['position'])?$transfer['ju']['position']:'' ;
                            $remarkJu = !empty($transfer['ju']['remark'])?$transfer['ju']['remark']:'' ;
                            //------------------------持有人--------------------
                            $contactChi = !empty($transfer['chi']['contact'])?$transfer['chi']['contact']:'' ;
                            $phoneChi = !empty($transfer['chi']['phone'])?$transfer['chi']['phone']:'' ;
                            $emailChi = !empty($transfer['chi']['email'])?$transfer['chi']['email']:'' ;
                            $addressChi = !empty($transfer['chi']['address'])?$transfer['chi']['address']:'' ;
                            $positionChi = !empty($transfer['chi']['position'])?$transfer['chi']['position']:'' ;
                            $remarkChi = !empty($transfer['chi']['remark'])?$transfer['chi']['remark']:'' ;
                            echo <<<JU
    <table class="tableRaius tablechiYou pull-left" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;"">
                    <tr>
                        <td  colspan="2">持有人信息</td>
                    </tr>
                     <tr>
                            <td>联系人</td>
                            <td>
                                <input type="text" name="" id="contactChi" value="$contactChi" />
                            </td>
                        </tr>
                        <tr>
                            <td>电 话</td>
                            <td>
                                <input type="tel" name="" id="phoneChi"   value="$phoneChi" />
                            </td>
                        </tr>
                        <tr>
                            <td>地 址</td>
                            <td>
                                <input type="text" name="" id="addressChi"  value="$addressChi" />
                            </td>
                        </tr>
                        <tr>
                            <td>邮 箱</td>
                            <td>
                                <input type="email" name="" id="emailChi" value=" $emailChi" />
                            </td>
                        </tr>
                        <tr>
                            <td>职 位</td>
                            <td>
                                <input type="text" name="" id="positionChi" value="$positionChi" />
                            </td>
                        </tr>
                        <tr>
                            <td>备 注</td>
                            <td>
                                <textarea name="" placeholder="请说明对本资产包的影响力" class='textarea-edit9 jYiJu' rows="" cols="" id="remarkChi">$remarkChi</textarea>
                            </td>
                        </tr>
                    </table>
  <table class="tableRaius tableJuJian pull-right" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
                        <tr>
                            <td  colspan="2">居间人信息</td>
                        </tr>
                         <tr>
                        <td>联系人</td>
                        <td>
                            <input type="text" name="" id="contactJu" value="$contactJu" />
                        </td>
                    </tr>
                    <tr>
                        <td>电 话</td>
                        <td>
                            <input type="tel" name="" id="phoneJu"    value="$phoneJu" />
                        </td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>
                            <input type="text" name="" id="addressJu" value="$addressJu" />
                        </td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>
                            <input type="email" name="email" id="emailJu" value="$emailJu" />
                        </td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>
                            <input type="text" name="" id="positionJu" value="$positionJu" />
                        </td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                            <textarea name="" placeholder="请说明对本资产包的影响力" class='textarea-edit9 bYiJu' rows="" cols="" id="remarkJu">$remarkJu</textarea>
                        </td>

                    </tr>
                      
                    </table>
JU;
                        }else if(!empty($transfer['chi']['transfer']) && $transfer['chi']['transfer']==1){
                            $contact = !empty($transfer['chi']['contact'])?$transfer['chi']['contact']:'' ;
                            $phone = !empty($transfer['chi']['phone'])?$transfer['chi']['phone']:'' ;
                            $email = !empty($transfer['chi']['email'])?$transfer['chi']['email']:'' ;
                            $address = !empty($transfer['chi']['address'])?$transfer['chi']['address']:'' ;
                            $position = !empty($transfer['chi']['position'])?$transfer['chi']['position']:'' ;
                            $remark = !empty($transfer['chi']['remark'])?$transfer['chi']['remark']:'' ;
                            echo <<<CHI
    <table class="tableRaius tablechiYou pull-left" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;  border:none!importrant">
                    <tr>
                        <td  colspan="2">持有人信息</td>
                    </tr>
                    <tr>
                        <td>联系人</td>
                        <td>
                            <input type="text" name="" id="contactChi" value="$contact" />
                        </td>
                    </tr>
                    <tr>
                        <td>电 话</td>
                        <td>
                            <input type="tel" name="" id="phoneChi"   value="$phone" />
                        </td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>
                            <input type="text" name="" id="addressChi" value="$address" />
                        </td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>
                            <input type="email" name="" id="emailChi" value="$email" />
                        </td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>
                            <input type="text" name="" id="positionChi" value="$position" />
                        </td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                            <textarea name="" placeholder="请说明对本资产包的影响力" class='textarea-edit9 bYiJu' rows="" cols="" id="remarkChi">$remark</textarea>
                        </td>

                    </tr>
                    </table>
                   </table>
  <table class="tableRaius tableJuJian pull-right" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0; display:none;border:none!importrant">
                        <tr>
                            <td  colspan="2">居间人信息</td>
                        </tr>
                        <tr>
                            <td>联系人</td>
                            <td>
                                <input type="text" name="" id="contactJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>电 话</td>
                            <td>
                                <input type="tel" name="" id="phoneJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>地 址</td>
                            <td>
                                <input type="text" name="" id="addressJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>邮 箱</td>
                            <td>
                                <input type="email" name="" id="emailJu" value=" " />
                            </td>
                        </tr>
                        <tr>
                            <td>职 位</td>
                            <td>
                                <input type="text" name="" id="positionJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>备 注</td>
                            <td>
                                <textarea name="" placeholder="请说明对本资产包的影响力" class='textarea-edit9 bYiJu' rows="" cols="" id="remarkJu"></textarea>
                            </td>

                        </tr>
                    </table>
CHI;
                        }else{
                            echo <<<WUDATA
 <table class="tableRaius tablechiYou pull-left" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;"">
                    <tr>
                        <td  colspan="2">持有人信息</td>
                    </tr>
                    <tr>
                        <td>联系人</td>
                        <td>
                            <input type="text" name="" id="contactChi" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td>电 话</td>
                        <td>
                            <input type="tel" name=""  id="phoneChi" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td>地 址</td>
                        <td>
                            <input type="text" name="" id="addressChi" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td>邮 箱</td>
                        <td>
                            <input type="email" name="" id="emailChi" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td>职 位</td>
                        <td>
                            <input type="text" name="" id="positionChi" value="" />
                        </td>
                    </tr>
                    <tr>
                        <td>备 注</td>
                        <td>
                            <textarea name="" placeholder="请说明对本资产包的影响力" rows="" class='textarea-edit9 jYiJu' cols="" id="remarkChi"></textarea>
                        </td>

                    </tr>
                    </table>
                   </table>
  <table class="tableRaius tableJuJian pull-right" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0; display:none; border:none">
                        <tr>
                            <td  colspan="2">居间人信息</td>
                        </tr>
                        <tr>
                            <td>联系人</td>
                            <td>
                                <input type="text" name="" id="contactJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>电 话</td>
                            <td>
                                <input type="tel" name="" id="phoneJu"   value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>地 址</td>
                            <td>
                                <input type="text" name="" id="addressJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>邮 箱</td>
                            <td>
                                <input type="email" name="" id="emailJu" value=" " />
                            </td>
                        </tr>
                        <tr>
                            <td>职 位</td>
                            <td>
                                <input type="text" name="" id="positionJu" value="" />
                            </td>
                        </tr>
                        <tr>
                            <td>备 注</td>
                            <td>
                                <textarea name="" placeholder="请说明对本资产包的影响力" class='textarea-edit9' rows="" cols="" id="remarkJu"></textarea>
                            </td>

                        </tr>
                    </table>
WUDATA;
                        }
                    }
                    ?>

                </form>
            </div>
          	 <div>
                <div class="cancelInConfirm clearfix">
                    <input id="ajaxMake" class="cancelInConfirmActive" type="button" value="保存" />
                    <input id='cancelMake' type="button" value="取消" />
                </div>
            </div>

        </div>
    </div>
    
    
    
    <!-- textarea 高度设置对比div -->
	<div style="max-height: 1px; overflow: hidden;">
		<div id="d9" style="visibility:hidden;min-height: 80px;" ></div>
	</div>
    <script>
        $(function () {
		    
		   var str = $('#cj').validate({
		    	debug:true
		    })
		    
		    
		   
            $("#ajaxMake").click(function () {
                var juRedio = $(".juJian").attr('class')=='juJian active'?2:1; //获取资产包提供方
                var wish = $("#wish").val();
                var expected_transfer = $("#expected_transfer").val();
                var detail = $("#detail").val();
                var method = 0;
                var contactJu = $("#contactJu").val();
                var phoneJu = $("#phoneJu").val();
                var addressJu = $("#addressJu").val();
                var emailJu = $("#emailJu").val();
                var positionJu = $("#positionJu").val();
                var remarkJu = $("#remarkJu").val();

                var contactChi = $("#contactChi").val();
                var phoneChi = $("#phoneChi").val();
                var addressChi = $("#addressChi").val();
                var emailChi = $("#emailChi").val();
                var positionChi = $("#positionChi").val();
                var remarkChi = $("#remarkChi").val();
                if(juRedio==1){
                        //转让方式
                        $('.zhuanRang p').find('label').each(function() {
                            if($(this).attr('class') == 'active'){
                                method =$(this).data('val');
                            }
                        })
                        data = {
                            'state':1,
                            'contact':contactChi,
                            'phone':phoneChi,
                            'address':addressChi,
                            'position':positionChi,
                            'remark':remarkChi,
                            'email':emailChi,

                            'method':method,
                            'wish':wish,
                            'expected_transfer':expected_transfer,
                            'detail':detail,
                            'project_id':project_id,
                            'package_id':package_id,
                        }
                        $.post('/project/ajax-save-transfer-project',{'data':data},function (res) {
                            var JSONData = JSON.parse(res)
                            if (JSONData.code == 200){
                                layer.msg(JSONData.message);
                                window.location.reload();
                            }else{
                                layer.msg(JSONData.message);
                            }
                        })
                }else{
                    $("#ajaxMake").click(function () {
                        //转让方式
                        $('.zhuanRang p').find('label').each(function() {
                            if($(this).attr('class') == 'active'){
                                method =$(this).data('val');
                            }
                        })
                        data = {
                            'state':2,
                            'contactJu':contactJu,
                            'phoneJu':phoneJu,
                            'addressJu':addressJu,
                            'positionJu':positionJu,
                            'remarkJu':remarkJu,
                            'emailJu':emailJu,
                            'contactChi':contactChi,
                            'phoneChi':phoneChi,
                            'addressChi':addressChi,
                            'emailChi':emailChi,
                            'positionChi':positionChi,
                            'remarkChi':remarkChi,
                            'method':method,
                            'wish':wish,
                            'expected_transfer':expected_transfer,
                            'detail':detail,
                            'project_id':project_id,
                            'package_id':package_id,
                        }
                        $.post('/project/ajax-save-transfer-project',{'data':data},function (res) {
                            var JSONData = JSON.parse(res)
                            if (JSONData.code == 200){
                                layer.msg(JSONData.message);
                                makeW1();
                            }else{
                                layer.msg(JSONData.message);
                            }
                        })
                    })
                }
                var court = ''; //
                var block = ''; //
                var data = {};
                })
        })

        //-----------------渲染无编辑页面--------------------
        function makeW1() {
            $.get('/project/get-base-data',{'project_id':project_id,'postion':10},function (res) {
                $(".zhuanRangXinXiW").children().remove();
                $(".zhuanRangXinXiW").html(res);
                $(".zhuanRangXinXiW").show();
                $(".zhuanRangXinXiEdit").children().remove();
            })
        }
        //---取消按钮
        $("#cancelMake").click(function () {
            $.post('/project/ajax-un-lock',{'postion':10,'project_id':project_id},function (res) {
                var JSONData = JSON.parse(res)
                if (JSONData.code == 200){
                    layer.msg(JSONData.message);
                }else{
                    layer.msg(JSONData.message);
                }
            })
            $(".zhuanRangXinXiEdit").hide();
            $(".zhuanRangXinXiW").show();
        })
        //点击居间人都展示
        $('.zhuanRangXinXiEdit').on('click','.juJian',function(){
            $(this).addClass('active');
            $('.zhuanRangXinXiEdit .chiYou').removeClass('active');
            $('.tablechiYou').show();
            $('.tableJuJian').show();
        })
        //点击持有人只展示持有人信息
        $('.zhuanRangXinXiEdit').on('click','.chiYou',function(){
            $(this).addClass('active');
            $('.zhuanRangXinXiEdit .juJian').removeClass('active')
            $('.tablechiYou').show();
            $('.tableJuJian').hide();
        })
        //点击转让方式
        $('.zhuanRang label').on('click',function(){
            $(this).addClass('active').siblings().removeClass('active')
        })
        
          //textarea编辑高度和输入框高亮显示功能开始
			var listArr = ['input']
			listArr.forEach(function(value,index,arr){
				$(value).focus(function(){
					$(this).css({
							"border":"1px solid #2194f1"
					})
				})
				$(value).blur(function(){
					$(this).css({
							"border":"1px solid #e2e2e2"
					})
				})
			})
			  // textarea 高度展示问题和高亮显示开始
			  $(document).on('focus','.textarea-edit9',function(){
			 	textareaHeight(this);
			 	$(this).css({
						"border":"1px solid #2194f1"
				})
			 })
			   $(document).on('blur','.textarea-edit9',function(){
			 	$(this).css({
						"border":"1px solid #e2e2e2"
				})
			 })
			  $(document).on('keyup','.textarea-edit9',function(){
		     	textareaHeight(this);
		     })
		     // textarea 2
		     function textareaHeight(th){
	    	 	var val = $(th).val();
			 	$("#d9").width($(th).width())
			     $("#d9").html("<pre>" +val+" "+"</pre>");
			     var h = $("#d9").height() ;
				 $(th).height(h);
			}
    </script>